<template>
  <div>
    <!--图片识别-->
    <el-card
      class="box-card"
      size="mini">
      <div
        slot="header"
        class="clearfix">
        <span>图片识别</span>
      </div>
      <div>
        <el-button
          v-for="(v, k) in dataArr"
          :key="k"
          type="primary"
          size="mini"
          @click="itemClick(k)">{{ v }}</el-button>
      </div>
    </el-card>
    <text-local-image
      ref="TextLocalImage"/>
    <text-url-image
      ref="TextUrlImage"/>
  </div>
</template>

<script>
import TextLocalImage from './text/localImage'
import TextUrlImage from './text/urlImage'
export default {
  name: 'WebToolImageIdentify',
  components: {
    TextLocalImage,
    TextUrlImage
  },
  data() {
    return {
      // 数据数组
      dataArr: [
        '文字识别(本地图片)',
        '文字识别(图片链接)'
      ]
    }
  },
  methods: {
    // item点击
    itemClick(index) {
      switch (index) {
        case 0:
          this.$refs['TextLocalImage'].show()
          break
        case 1:
          this.$refs['TextUrlImage'].show()
          break
      }
    }
  }
}
</script>

<style scoped>

</style>
